/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author alumno
 */
@Entity
@Table(name = "ALUMNO_TIPO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "AlumnoTipo.findAll", query = "SELECT a FROM AlumnoTipo a"),
    @NamedQuery(name = "AlumnoTipo.findByAlutCod", query = "SELECT a FROM AlumnoTipo a WHERE a.alutCod = :alutCod"),
    @NamedQuery(name = "AlumnoTipo.findByAlutDesc", query = "SELECT a FROM AlumnoTipo a WHERE a.alutDesc = :alutDesc")})
public class AlumnoTipo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ALUT_COD")
    private Integer alutCod;
    @Basic(optional = false)
    @Column(name = "ALUT_DESC")
    private String alutDesc;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "alumnoTipo", fetch = FetchType.LAZY)
    private List<Precio> precioList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "alutCod", fetch = FetchType.LAZY)
    private List<Alumno> alumnoList;

    public AlumnoTipo() {
    }

    public AlumnoTipo(Integer alutCod) {
        this.alutCod = alutCod;
    }

    public AlumnoTipo(Integer alutCod, String alutDesc) {
        this.alutCod = alutCod;
        this.alutDesc = alutDesc;
    }

    public Integer getAlutCod() {
        return alutCod;
    }

    public void setAlutCod(Integer alutCod) {
        this.alutCod = alutCod;
    }

    public String getAlutDesc() {
        return alutDesc;
    }

    public void setAlutDesc(String alutDesc) {
        this.alutDesc = alutDesc;
    }

    @XmlTransient
    public List<Precio> getPrecioList() {
        return precioList;
    }

    public void setPrecioList(List<Precio> precioList) {
        this.precioList = precioList;
    }

    @XmlTransient
    public List<Alumno> getAlumnoList() {
        return alumnoList;
    }

    public void setAlumnoList(List<Alumno> alumnoList) {
        this.alumnoList = alumnoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (alutCod != null ? alutCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AlumnoTipo)) {
            return false;
        }
        AlumnoTipo other = (AlumnoTipo) object;
        if ((this.alutCod == null && other.alutCod != null) || (this.alutCod != null && !this.alutCod.equals(other.alutCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.AlumnoTipo[ alutCod=" + alutCod + " ]";
    }
    
}
